#include"Comm.hpp"
int main()
{
    int wfd = open(Path,O_WRONLY);
    if(wfd<0)
    {
        cerr<<"open file fail,erron:"<<errno<<"errno string"<<strerror(errno)<<endl;
        return 1;
    }
    
    string inbuffer;
    while(true)
    {
        cout<<"please enter your message"<<endl;
        getline(cin,inbuffer); // 从标准输入中读取
        if(inbuffer == "quit")
        {
            break;
        }
        ssize_t n = write(wfd,inbuffer.c_str(),inbuffer.size());
        if(n>0)
        {

        }
        else if(n ==-1)
        {
            cerr<<"write file fail,erron:"<<errno<<"errno string"<<strerror(errno)<<endl;
            break;
        }
    }
    close(wfd);
    sleep(1);
    return 0;
}